<template>
    <a-card :bordered="false">
        <div class="table-operator">
            <a-button shape="round" size="small" type="primary" icon="plus" @click="handleEdit({},'stationForm','新增')">添加</a-button>
        </div>

        <LTable
        ref="stationList"
        size="middle"
        rowKey="keyId"
        :formAttributes="formAttributes"
        :columns="columns"
        axiosUrl="/KhyStationController/page"
        :showPagination="true"
        :showQueryForm="true"
      >

        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record,'stationForm',record.stationName)">详情</a>
          <a-divider type="vertical" />
          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete({keyId:record.keyId},'/KhyStationController/del','stationList')">
                <a>删除</a>
            </a-popconfirm>
        </span>
        
    </LTable>
    <stationForm ref="stationForm" @close="refresh('stationList')" @ok="refresh('stationList')"></stationForm> 
    </a-card>
</template>

<script>
import LTable from '@/components/lt/LTable'
import request from '@/utils/request'
import stationForm from './stationForm'
import {SysMixin} from '@/mixins/SysMixin'
import defaultSettings from '@/config/defaultSettings'
export default {
    name:'busList',
    components:{LTable,stationForm},
    mixins:[SysMixin],
    data(){
        return{
 
            defaultSettings,
            formAttributes:[
                
                {field:'stationName',label:'客运站名称',component:'input',condition:'like'},
            ],
         
            columns:[
                {
                    title: '序号',
                    dataIndex: '',
                    key:'rowIndex',
                    width:60,
                    align:"center",
                    customRender:function (t,r,index) {
                      return parseInt(index)+1;
                    }
                },
               
                
                {
                    title: '客运站名称',
                    dataIndex: 'stationName'
                },
                
                {
                    title: '客运站地址',
                    dataIndex: 'stationAddress'
                },
                
                {
                    title: '操作',
                    dataIndex: 'action',
                    width: '120px',
                    scopedSlots: { customRender: 'action' }
                }
            ],
            
        }
    },
    created(){
       
    },
    methods:{
       
    }
}
</script>